package net.homelinux.chaoswg.io.renga.krypto.operations.numerical;

import net.homelinux.chaoswg.io.datatypes.Pair;
import net.homelinux.chaoswg.io.higherorderfunctions.AbstractBinaryFunction;
import net.homelinux.chaoswg.io.higherorderfunctions.BinaryFunction;
import net.homelinux.chaoswg.io.renga.krypto.datatypes.numerical.UnsignedNBit;

public class Pht extends AbstractBinaryFunction<Pair<? extends UnsignedNBit, ? extends UnsignedNBit>, UnsignedNBit, UnsignedNBit> implements BinaryFunction<Pair <? extends UnsignedNBit, ? extends UnsignedNBit>, UnsignedNBit, UnsignedNBit>{
    public final Pair<? extends UnsignedNBit, ? extends UnsignedNBit> apply (final UnsignedNBit u0, final UnsignedNBit u1) {
        final UnsignedNBit p0 = u0.add (u1);
        final UnsignedNBit p1 = p0.add (u1);
        
        return new Pair<UnsignedNBit, UnsignedNBit> (p0, p1);
    }
    
    public String toString () {
        return "PHT";
    }
}
